<template>
    <div class="app">
         
    <mt-header fixed title="西噶">
     <!-- <mt-button icon="back"slot="left" :v-link="'/'">返回</mt-button>
      <mt-button icon="more" slot="right" ></mt-button> -->

      <span to="/one" slot="left" @click="go" v-show="flag">
      <mt-button icon="back">返回</mt-button>
      </span>
    </mt-header>
   
   <transition mode="out-in">
    <router-view/>
  </transition>
<nav class="mui-bar mui-bar-tab">
			<router-link to="/one" class="mui-tab-item-one ">
				<span class="mui-icon mui-icon-home"></span>
				<span class="mui-tab-label">首页</span>
			</router-link>
			<router-link to="/two" class="mui-tab-item-one" >
				<span class="mui-icon mui-icon-contact"><span class="mui-badge">9</span></span>
				<span class="mui-tab-label">会员</span>
			</router-link>
			<router-link to="/three" class="mui-tab-item-one" >
				<span class="mui-icon mui-icon-extra mui-icon-extra-cart">
          <span class="mui-badge" id="badge">{{this.$store.getters.gettets}}</span>
        </span>
       
				<span class="mui-tab-label">购物车</span>
			</router-link>
			<router-link to="/four" class="mui-tab-item-one" >
				<span class="mui-icon mui-icon-gear"></span>
				<span class="mui-tab-label">设置</span>
			</router-link>
		</nav>





    </div>
</template>
<script>



export default {
     data() {
       return {
         flag:false
       }
     },
     created() {
       this.flag=this.$route.path=="/one"?false:true
     },
     methods: {
       go(){
         this.$router.go(-1)
       }
     },
   watch:{
     "$route.path":function (newval) {
       if (newval=="/one") {
         this.flag=false
       }else{
         this.flag=true
       }
     }
   }
}
</script>
<style lang="scss" >
 .app{
    padding-top: 40px;
	overflow-x:hidden;
	padding-bottom: 40px;
 }
 .v-enter,.v-leave-to{
   opacity: 0;
   transform: translateY(100%);
 }
 .v-leave-to{
   opacity: 0;
   transform: translateY(-100%);
 }
 .v-ente-active,.v-leave-active{

	 transition:all 0.3s ease;
 }
 .mui-bar-tab .mui-tab-item-one{
    display: table-cell;
    overflow: hidden;
    width: 1%;
    height: 50px;
    text-align: center;
    vertical-align: middle;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: #929292;
}
.mui-bar-tab .mui-tab-item-one .mui-icon {
    top: 3px;
    width: 24px;
    height: 24px;
    padding-top: 0;
    padding-bottom: 0;
}
.mui-bar .mui-icon {
    font-size: 24px;
    position: relative;
    z-index: 20;
    padding-top: 10px;
    padding-bottom: 10px;
} 
.mui-bar-tab .mui-tab-item-one .mui-icon~.mui-tab-label {
    font-size: 11px;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mui-bar-tab .mui-tab-item-one.mui-active {
    color: #007aff;
}
.mint-header{
  //空间级别排名
  z-index:99; 
}
</style>